package com.example.designpatterns.strategy;

import java.util.Scanner;

public class Test {

    public static void main(String[] args) {
        //正常收费、满300返100、打8折

        Scanner cin = new Scanner(System.in);

        System.out.println("请输入优惠方案：");
        String str = cin.next();
        CashContext cc = new CashContext(str);

        System.out.println("请输入消费金额：");
        double price = cin.nextInt();
        double total = cc.getResult(price);

        System.out.println("最终消费：" + total);
        cin.close();
    }

}